#!/bin/bash


source ${SCRIPTS_HOME}/lib/docker.sh

MMS_APP=${DEPLOY_HOME}/${PROJECT}
CONTAINER=${PROJECT}

# stop container
echo "> stop and remove old containers..."
stop_containers ${CONTAINER}
remove_containers ${CONTAINER}
sleep 5s

# build new container
echo "> buildding application container..."
build_mms_container ${CONTAINER} ${MMS_APP}

# start container
echo "> start container ${CONTAINER}..."
start_container ${CONTAINER}
sleep 5s

# check container run sunccess
check_container ${CONTAINER}

echo "> all containers:"
show_containers

echo "> running containers:"
show_running_containers

echo "> done."